package service;

import say.SayHello;

public class SayHelloService {

    private SayHello say;

    public void helloWorld() {
        for (int i = 0; i < 10; i++) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
                System.err.println("Thread can't sleep");
            }
            say.sayHello();
        }
    }

    public void setSay(SayHello say) {
        this.say = say;
    }
}